﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlueFlyPhone
{
    public class VarioUnitConverter : IUnitConverter
    {


        public string DisplayUnit
        {
            get { return "m/s"; }
        }


        public double ConvertToCalculationUnits(double value)
        {

            return value;
        }

        public string ConvertToDisplayUnits(double value, int precision)
        {
            return Math.Round(value, precision).ToString();
            
        }
    }


    public class FtPerMinVarioUnitConverter : IUnitConverter
    {


        public string DisplayUnit
        {
            get { return "ft/min"; }
        }


        public const double conversionFactor = 3.28084 * 60;

        public double ConvertToCalculationUnits(double value)
        {

            return value * conversionFactor;
        }

        public string ConvertToDisplayUnits(double value, int precision)
        {
            return Math.Round(value /conversionFactor , precision).ToString();

        }
    }

}
